package com.smartparking.repository;

import org.springframework.core.annotation.Order;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author ganru
 * @date 2025/11/3 18:58
 */
@Repository
public interface OrderRepository extends JpaRepository<Order, Integer> {
    // 根据用户ID查找订单
    List<Order> findByUserUserId(Integer userId);

    // 查找某车位的订单
    List<Order> findByParkingSpaceSpaceId(Integer spaceId);

    // 查找某预约的订单
    List<Order> findByReservationReservationId(Integer reservationId);
}